fe05f47926a333c6ce70158c7816e68caf119539,name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/pdf/ComdirectPDFExtractor.java,ComdirectPDFExtractor,addSellTransaction,#,140
Before Change
.match("(\\S{1,} )* *(?<isin>\\S*) *$") //
.assign((t, v) -> t.setSecurity(getOrCreateSecurity(v)))
.section("shares") //
.match("^St\\. *(?<shares>\\d+(,\\d+)?) .*") //
.assign((t, v) -> t.setShares(asShares(v.get("shares"))))
.section("amount", "currency") //
.find(".*Zu Ihren Gunsten vor Steuern *") //
.match(".*(\\w{3}+) *\\d+.\\d+.\\d{4}+ *(?<currency>\\w{3}+) *(?<amount>[\\d.]+,\\d+).*") //
.assign((t, v) -> {
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setAmount(asAmount(v.get("amount")));
})
.section("fee", "currency") //
.optional().match(".*Summe Entgelte *: *(?<currency>\\w{3}+) *(?<fee>[\\d.-]+,\\d+)-? *") //
.assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE,
Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee"))))))
.wrap(t -> new BuySellEntryItem(t)));
}
After Change
.match("(\\S{1,} )* *(?<isin>\\S*) *$") //
.assign((t, v) -> t.setSecurity(getOrCreateSecurity(v)))
.section("shares").optional() //
.match("^St\\. *(?<shares>\\d+(,\\d+)?) .*") //
.assign((t, v) -> t.setShares(asShares(v.get("shares"))))
.section("shares").optional() // teilausführung
.match("^ Summe *St\\. *(?<shares>\\d+(,\\d+)?) .*") //
.assign((t, v) -> t.setShares(asShares(v.get("shares"))))
.section("amount", "currency") //
.find(".*Zu Ihren Gunsten vor Steuern *") //
.match(".*(\\w{3}+) *\\d+.\\d+.\\d{4}+ *(?<currency>\\w{3}+) *(?<amount>[\\d.]+,\\d+).*") //
.assign((t, v) -> {
t.setCurrencyCode(asCurrencyCode(v.get("currency")));
t.setAmount(asAmount(v.get("amount")));
})
.section("fee", "currency").optional()
.match(".*Provision *: *(?<currency>\\w{3}+) *(?<fee>[\\d.-]+,\\d+)-? *") //
.assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE,
Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee"))))))
.section("fee", "currency").optional()
.match(".*B.rsenplatzabh.ng. Entgelt *: *(?<currency>\\w{3}+) *(?<fee>[\\d.-]+,\\d+)-? *") //
.assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE,
Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee"))))))
.section("fee", "currency").optional()
.match(".*Abwickl.entgelt Clearstream *: *(?<currency>\\w{3}+) *(?<fee>[\\d.-]+,\\d+)-? *") //
.assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE,
Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee"))))))
.section("fee", "currency").optional()
.match(".*Gesamtprovision *: *(?<currency>\\w{3}+) *(?<fee>[\\d.-]+,\\d+)-? *") //
.assign((t, v) -> t.getPortfolioTransaction().addUnit(new Unit(Unit.Type.FEE,
Money.of(asCurrencyCode(v.get("currency")), asAmount(v.get("fee"))))))
.wrap(t -> new BuySellEntryItem(t)));
}